package net.sky.oa.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * 个人通讯录
 * AddMyaddr. @author hond
 */
@Entity
@Table(name = "ADD_MYADDR")//个人通讯录
public class AddMyaddr implements Serializable {

	private static final long serialVersionUID = 5673991033245515351L;
	
	// Fields
	private Long id;
	private String name;    //姓名
	private String nickname;    //姓名
	private String enname;  //英文名
	private String sex;     //性别,1男2女
	private String tel;     //电话
	private String mobile;  //手机号码
	private String cornet;  //手机短号
	private String qq;      //腾讯qq
	private String msn;     //msn
	private String email;   //电子邮箱
	private String homepage;//个人主页
	private String address; //地址
	private String postion; //职务
	private String company; //公司
	private Integer status;    //状态,共享状态：1是2否
	private SysEmployee user; //员工id
	private AddGroup group; //分组id

	// Constructors

	/** default constructor */
	public AddMyaddr() {
	}

	/** minimal constructor */
	public AddMyaddr(Long id) {
		this.id = id;
	}
	@Id 
	@SequenceGenerator(name="SQ_ADDMYADDR_ID",sequenceName="SQ_ADDMYADDR_ID",allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="SQ_ADDMYADDR_ID")
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "NAME", length = 10)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@Column(name = "NICkNAME", length = 10)
	public String getNickname() {
		return this.nickname;
	}
	
	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	@Column(name = "ENNAME", length = 20)
	public String getEnname() {
		return this.enname;
	}

	public void setEnname(String enname) {
		this.enname = enname;
	}

	@Column(name = "SEX", length = 2)
	public String getSex() {
		return this.sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	@Column(name = "TEL", length = 15)
	public String getTel() {
		return this.tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	@Column(name = "MOBILE", length = 15)
	public String getMobile() {
		return this.mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	@Column(name = "CORNET", length = 8)
	public String getCornet() {
		return this.cornet;
	}

	public void setCornet(String cornet) {
		this.cornet = cornet;
	}

	@Column(name = "QQ", length = 12)
	public String getQq() {
		return this.qq;
	}

	public void setQq(String qq) {
		this.qq = qq;
	}

	@Column(name = "MSN", length = 40)
	public String getMsn() {
		return this.msn;
	}

	public void setMsn(String msn) {
		this.msn = msn;
	}

	@Column(name = "EMAIL", length = 40)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "HOMEPAGE", length = 50)
	public String getHomepage() {
		return this.homepage;
	}

	public void setHomepage(String homepage) {
		this.homepage = homepage;
	}

	@Column(name = "ADDRESS", length = 60)
	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Column(name = "POSTION", length = 20)
	public String getPostion() {
		return this.postion;
	}

	public void setPostion(String postion) {
		this.postion = postion;
	}

	@Column(name = "COMPANY", length = 60)
	public String getCompany() {
		return this.company;
	}

	public void setCompany(String company) {
		this.company = company;
	}
	
	@Column(name = "STATUS", length = 1)
	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "USER_ID")
	public SysEmployee getUser() {
		return this.user;
	}

	public void setUser(SysEmployee suserer) {
		this.user = suserer;
	}
	
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "GROUP_ID")
	public AddGroup getGroup() {
		return this.group;
	}
	
	public void setGroup(AddGroup group) {
		this.group = group;
	}

}